<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Setores extends CI_Controller {

	function __construct() {
		parent::__construct();
		if(!$this->session->userdata('grambel')){
			$this->session->sess_destroy();
			redirect('login', 'refresh');
		}
	}
	public function index()
	{
		$this->load->view('inicio');
	}
	public function selecionaSetor(){

		$setor = new Setor();
		$setor = $setor->where("secretaria_id",$this->input->get('id'))->order_by("nomesetor asc")->get();
		
		$data = array();
		foreach($setor as $s){
			$data [] = array('optionValue'=>$s->id ,'optionDisplay' =>$s->nomesetor);
		}
	
		echo json_encode($data);
	
	
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */